/**
	Article 2 Code Sample
	Local OpenGL Environment
	
	
*/

#include<GL/glut.h>
#include<GL/glu.h>
#include<stdio.h>
#include <string.h>

void
print( char * string )
{
	int i=0;
	while(string[i]) 	
		glutBitmapCharacter(GLUT_BITMAP_8_BY_13,string[i++]);	

}

void
render()
{
	glColor3f(1.0f,1.0f,1.0f);
	glClear(GL_COLOR_BUFFER_BIT);
	char temp[100];

	glRasterPos2f(-0.9,0.9);	
	strcpy(temp,glGetString(GL_VENDOR));
	print(temp);
	glRasterPos2f(-0.9,0.83);
	strcpy(temp,glGetString(GL_VERSION));
	print(temp);	
	glRasterPos2f(-0.9,0.76);
	print("********* Check console for details **********");

	glFlush();
}

int main(int argc, char *argv[])
{
	glutInit(&argc,argv);
	glutInitDisplayMode(GLUT_RGB);
	glClearColor(0.0f,0.0f,0.0f,0.0f);
	glutInitWindowSize(500,500);
	glutInitWindowPosition(100,200);
	glutCreateWindow("window");
	glutDisplayFunc(render);
	printf("Vendor: %s\n",glGetString(GL_VENDOR));
	printf("GL version: %s\n",glGetString(GL_VERSION));
        printf("GL render: %s\n",glGetString(GL_RENDERER));	printf("\n\nSupported extensions: %s\n\n",glGetString(GL_EXTENSIONS));    
    	printf("GLU version: %s\n",gluGetString(GLU_VERSION));
	printf("GLU extensions: %s\n",gluGetString(GLU_EXTENSIONS));
	glutMainLoop();	
	return 0;
}

/**
	Author: seb
	Email: sebthestampede@gmail.com
	Home: http://seb.tnb.pl/
	
	If you want to use some of the code in your programs, please add this comment to your file.
*/

